---
sidebar_class_name: hidden
---

# Analyze Document

The AnalyzeDocumentChain can be used as an end-to-end to chain. This chain takes in a single document, splits it up, and then runs it through a CombineDocumentsChain.

import CodeBlock from "@theme/CodeBlock";
import AnalyzeDocumentExample from "@examples/chains/analyze_document_chain_summarize.ts";

The below example uses a `MapReduceDocumentsChain` to generate a summary.

import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";

<IntegrationInstallTooltip></IntegrationInstallTooltip>

```bash npm2yarn
npm install @langchain/openai
```

<CodeBlock language="typescript">{AnalyzeDocumentExample}</CodeBlock>
